<?php
namespace app\api\validate;
use think\Validate;

class Addr extends Validate{
	public $message=[
    	'province_id.require'=>'请选择省',
    	'city_id.require'=>'请选择市',
    	'area_id.require'=>'请选择区',
    	'username.require'=>'请填写联系人',
    	'mobile.require'=>'请填写联系电话',
    	'type.require'=>'默认寄件地址不能为空',
    	'id.require'=>'编辑时ID不能不存在'
    ];
    
   	public $rule=[
	   	'province_id'=>'require|number',
	   	'city_id'=>'require|number',
	   	'area_id'=>'require|number',
	   	'username'=>'require',
	   	'mobile'=>'require|mobile',
	   	'type'=>'require|number',
	   	'id'=>'require|number',
   	];
    public $scene=[
    	'addAddress'=>['province_id','city_id','area_id','username','mobile','details','type'],
    	'editAddress'=>['province_id','city_id','area_id','username','mobile','details','type','id'],
    ]; 
    
}
?>